package com.timguan.render.api.entity.cms;

/**
 * 专题的状态
 * Created by guankaiqiang on 2015/3/22.
 */
public enum CMSTopicStatus {
    DRAFT(0, "草稿"),
    PUBLISH(1, "上线");
    CMSTopicStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    private int    code;
    private String desc;
    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public static CMSTopicStatus getStatus(int code) {
        for (CMSTopicStatus status : CMSTopicStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        return null;
    }

}
